set more off

use dataset, clear

keep if abs(x) < 100

#delimit

gr tw 
	(sc dturnout20142010 x, msize(tiny) col(gs13))
	(lpolyci dturnout20142010 x if x < 0, clcol(black) lwid(medthick) ciplot(rline) alpat(solid) alcol(black) alwid(thin))
	(lpolyci dturnout20142010 x if x > 0, clcol(black) lwid(medthick) ciplot(rline) alpat(solid) alcol(black) alwid(thin))
	,
		ylab(-20(10)10 , angle(horiz) nogrid)
		plotregion(style(none))
		subtitle(, fcol(none) lwid(none))
		xline(0)
		ylab(, angle(horiz))
		xtitle("Distance from nearest state border")
		legend(off)
		ytitle("Change in voter turnout")
		title("2014-2010")
		legend(off)
		nodraw
		name(g1, replace)
		;		
	
#delimit cr

#delimit

gr tw 
	(sc dturnout20162012 x, msize(tiny) col(gs13))
	(lpolyci dturnout20162012 x if x < 0, clcol(black) lwid(medthick) ciplot(rline) alpat(solid) alcol(black) alwid(thin))
	(lpolyci dturnout20162012 x if x > 0, clcol(black) lwid(medthick) ciplot(rline) alpat(solid) alcol(black) alwid(thin))
	,
		ylab(-20(10)10 , angle(horiz) nogrid)
		plotregion(style(none))
		subtitle(, fcol(none) lwid(none))
		xline(0)
		ylab(, angle(horiz))
		xtitle("Distance from nearest state border")
		legend(off)
		ytitle("Change in voter turnout")
		title("2016-2012")
		legend(off)
		nodraw
		name(g2, replace)
		;
	
#delimit cr

gr combine g1 g2, rows(1) title("Change in turnout") name(G1, replace) 

gr export "_output/figureA9.pdf", replace
gr close
